home *** CD-ROM | disk | FTP | other *** search
-
- /*
- There may be additional include files required depending
- upon the compile product you are using. Typical compilers
- include Microsoft C by Microsoft or Turbo C by Boland Int'l.
- */
- #include <stdio.h>
- #define ON 1
- #define OFF 0
- #define TRUE 7
-
- struct flag{
- unsigned int pflag:1;
- unsigned int sflag:1;
- unsigned int jflag:3;
- } type;
-
- main()
- {
- type.pflag = ON;
- type.sflag = OFF;
- type.jflag = TRUE;
-
- if(type.pflag)
- printf("flag is ON\n");
- else
- printf("flag is OFF\n");
- type.pflag = 7;
- printf("%d\n",type.pflag); /* will print 1 */
-
- }
-